package ex2.finaltest;

import  static  java.lang.Math.*; //使用静态导入

/**
 * @author: knowno
 * @create: 2024-09-06 09:55
 * @Version 1.0
 **/
public class TestFinal {
    final int a = 1;//直接赋值

    final int b; //2 使用构造赋值

    public TestFinal() {
        this.b = 1;
    }

    public TestFinal(int b) {
        this.b = b;
    }

    //使用final修饰的方法不能被重写.
    public final void test1() {

        System.out.println(PI);
    }
}

class Test2 extends TestFinal {

//    public void test1() {
//    }

}

final class Test3{}
//Cannot inherit from final 'ex2.finaltest.Test3'
//class  Test4 extends  Test3{
//
//}